package hn.cch.demo.factory;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TemplateFactoryDemo {

    private static final Logger logger = LoggerFactory.getLogger(TemplateFactoryDemo.class);


    public static void main(String[] args) {
        // BeanFactory添加BeanPostProcessor使用模板方法设计模式
        TemplateFactory templateFactory = new TemplateFactory();
        // 灵活添加拓展功能
        templateFactory.addTemplateProcessor(object -> logger.info("处理@Configuration注解"));
        templateFactory.addTemplateProcessor(object -> logger.info("处理@Autowired注解"));
        Object object = templateFactory.getObject();
    }

}
